# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/7/12
# @File : A. Binary Search(CF).py
# https://codeforces.com/edu/course/2/lesson/6/1/practice/contest/283911/problem/A


def re(char,rate:list):
    for i in rate:
        if(i in char):
            print("YES")
        else:
            print("NO")
def bisearch(l,r,char,x):
    while(l+1<r):
        mid = (l+r)//2
        if(char[mid]==x):
            return True
        elif(char[mid]<x):
            l =mid
        else:
            r =mid
    return False
def bi(n,k,char,rate):
    for i in rate:
        if(bisearch(-1,n,char,i)):
            print("YES")
        else:
            print("NO")


if __name__ == '__main__':
    n,k = map(int,input().split())
    char = [int(i) for i in input().split()]
    rate = [int(i) for i in input().split()]
    #re(char,rate)
    bi(n,k,char,rate)
